/*
 * @Author: sunzhijun 
 * @Date: 2019-08-08 13:22:06 
 * @Last Modified by: sunzhijun
 * @Last Modified time: 2019-10-15 18:57:50
 */

import React, {Component} from 'react';
import {render, connect} from 'src/hrpub/common/frame';
import {toast, base} from 'nc-lightapp-front';
import TableHeaderAction from './action/TableHeaderAction';

import './index.less';

const TableHead = render({
    actions: {
        tableHeaderAct: TableHeaderAction
    }
})(({props, state, action}) => {
    const {
        NCButton
    } = base;
    const { main , moduleId} = props;
    let { subTableEditable, language } = main;
    return (
        <div class="add-new-page-table-operator">
            {
                subTableEditable ?
                <div>
                    <NCButton
                        colors="normal"
                        onClick={ ()=> action.tableHeaderAct.addRows(moduleId) }
                        // disabled={buttonDisable || addButtonDisable}
                    >
                       {/* 国际化处理： 增加 */}
                        {language['hi6007-000083']}
                    </NCButton>
                    <NCButton
                        colors="normal"
                        onClick={  ()=> action.tableHeaderAct.deleteRows(moduleId) }
                        // disabled={buttonDisable}
                    >
                        {/* 国际化处理：删除 */}
                        {language['hi6007-000031']}
                    </NCButton>
                    
                </div> : null
            }
        </div>
    );
});


export default TableHead;

